home *** CD-ROM | disk | FTP | other *** search
- Path: hermes.louisville.edu!starbase!gclind01
- From: gclind01@starbase.spd.louisville.edu (George C. Lindauer)
- Newsgroups: comp.os.msdos.programmer,comp.lang.asm.x86,comp.lang.c
- Subject: Re: Urg,ent, keyboard buffer overflow
- Date: 26 Feb 1996 17:22:17 GMT
- Organization: University of Louisville, Louisville KY USA
- Message-ID: <4gsq89$48t@hermes.louisville.edu>
- References: <Pine.SOL.3.91.960225103721.16366A-100000@hamlet.uncg.edu>
- NNTP-Posting-Host: starbase.spd.louisville.edu
- X-Newsreader: NN version 6.5.0 CURRENT #16
-
- "Bin . Lee" <b_lee2@hamlet.uncg.edu> writes:
-
-
- >Hi, folks:
-
- >I wrote a DOS program in Borland C++, because my interrupt service routine
- >block OS for 3 millisecond of every 5 millisecond, I think this cause
- >bios no time to serve and check keyboard buffer, which cause keybord buffer
- >overflow.
-
- >Two questions:
- >1. related to process of bios handler keyboard buffer, when IRQ1 generate
- >a interrupt, but has not finished its ISR, can other IRQ, such as IRQ7
- >generate a interrupt in between ? How can keyboard buffer overflow happen ?
-
- If you have to have an ISR that takes so long, it is good to issue the EOI
- (out 20h, 20h) early in the interrupt so higher interrupts can interrupt you.
- In general though if processing takes so long you defer it from the ISR to
- a task and just get out of the ISR.
-
- >2. cli and sti will disable and enable all IRQ, is there a instruction which
- >will only disable and enable one specific IRQ, like IRQ7.
-
- For the lower 8 IRQs, you can access port 21h. IRQ 7 corresponds to bit 7;
- to enable IRQ7 you would do:
-
- in al,21h
- and al,07fh
- out 21h,al
-
- and to disalbe it you would do:
-
- in al,21h
- or al,80h
- out 21h,al
-
- This is a PC hardware thing, not something that is built into the x86
- processor series.
-
- David
-
- >structure of my program
-
- >int main(void)
- >{
- > InstallExternalTimingIRQ7ISR()
-
- > while( waitkey() )
- > {
- > doKeyboardInput_ScrOutout();
- > }
- >
- > ReinstallOldIRQ7ISR();
- >}
- >My interrupt happens every 5 ms and program need 3 ms to finish its ISR,
- >during this time, I use cli and sti to protect its service, how will this
- >affect keyboard interrupt ? The interrupt I used is external circuit
- >generate 5 ms interrupt connect to IRQ7.
-
- >Thanks folks, this is urgent for me, please send me a mail.
-
-
- >Bin
-